package com.quanta.edaily.Service;

import com.quanta.edaily.bean.JsonResponse;
import com.quanta.edaily.pojo.User;
import jakarta.validation.constraints.Pattern;
import org.springframework.validation.annotation.Validated;

@Validated
public interface UserService {
    JsonResponse loginByEDailyId(String edailyId, String password);

    JsonResponse findPage(int pageNum, int pageSize);

    Integer countAllUser();

    JsonResponse register(String name, String phone, String password);

    JsonResponse updateUserById(User user);

    JsonResponse deleteUserById(Integer id);

    JsonResponse updatePasswordById(Integer id,
        @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d).+$", message = "密码至少包含一个字母和一个数字") String op,
        @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d).+$", message = "密码至少包含一个字母和一个数字") String np);

    JsonResponse getUserById(Integer id);

    JsonResponse getAll();

    JsonResponse getPublished();
}
